﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace Nanohope_v1._0
{
    class MenuInGame: GeneralCanvas
    {
        Skills skills;
        QuestLog questLog;
        Map map;
        Attributes attributes;
        GeneralCanvas showingMenu;
        KeyboardState keyState;

        public MenuInGame(PlayerStats stats)
        {
            skills = new Skills(stats);
            questLog = new QuestLog(stats);
            map = new Map(stats);
            attributes = new Attributes(stats);
            showingMenu = map;
        }

        public override void gameUpdate(GameTime gameTime)
        {
            showingMenu.gameUpdate(gameTime);
            checkKeys(gameTime);
        }

        public override void onDraw(SpriteBatch spriteBatch)
        {
            showingMenu.onDraw(spriteBatch);
        }
        protected override void checkKeys(GameTime gameTime)
        {
            keyState = Keyboard.GetState();
            if (keyState.IsKeyDown(Keys.D1))
            {
                showingMenu = map;
            }
            if (keyState.IsKeyDown(Keys.D2))
            {
                showingMenu = skills;
            }
            if (keyState.IsKeyDown(Keys.D3))
            {
                showingMenu = questLog;
            }
            if (keyState.IsKeyDown(Keys.D4))
            {
                showingMenu = attributes;
            }
            if (keyState.IsKeyDown(Keys.D5))
            {
                CanvasManager.instance.backToGame();
            }
        }

    }
}
